#include<stdio.h>
#include<stdlib.h>
int *findErrorNums(int *nums, int numsSize, int *returnSize) {
    int arr[10002] = {0};
    int *res = malloc(sizeof(int) * 3);

    for (int i = 0; i < numsSize; ++i) {
        arr[nums[i]]++;
        if(arr[nums[i]]==2) res[0] = nums[i];
    }
    for (int i = 0; i < numsSize; ++i) {
        if(arr[i+1]==0) res[1] = i+1;
    }
    *returnSize = 2;
    return res;
}


